package net.dao.impl;

import java.util.List;

import net.dao.RasgoClaseDao;
import net.model.RasgoClase;

import org.hibernate.Criteria;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository(value = "rasgoClaseDao")
public class RasgoClaseDaoImpl implements RasgoClaseDao {

	@Autowired
	private SessionFactory sessionFactory;

	@Override
	public List<RasgoClase> getAllRasgoClase() {
		Criteria criteria = sessionFactory.getCurrentSession().createCriteria(
				RasgoClase.class);
		return (List<RasgoClase>) criteria.list();
	}

	@Override
	public void saveRasgoClase(RasgoClase rasgoClase) {
		sessionFactory.getCurrentSession().saveOrUpdate(rasgoClase);
	}
}
